GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing docs.nativebase.io — Customizing Components | NativeBase | Universal Components for React and React Native Customizing Components | NativeBase | Universal Components for React and React NativeDisclosure If you are starting a new project, please try gluestack-ui for better performance and new design. Customizing Components Theme customisation is at the heart of NativeBase. Using NativeBase's extendTheme function, we can customise components. Components can be customised by overriding baseStyle/defaultProps or adding a new variant. Let's customise a Button component to include rounded borders and red colorScheme. Basic
As shown above, we can customize components by passing the components object with the key being the name of the component. Whereas you set defaultProps or baseStyle to customize the components. Difference between baseStyle and defaultProps Base Style As the name suggests, it's used to define the base style of a component. Base style can be a function or a plain object. Use function if you want to get access to defaultProps, current colorMode (light/dark) and theme object. Take a look at an . Default Props Default props can be used to initialize props of a component. For e.g. You have a Button component and it has 2 variants. i.e. outline, solid. Take a look at an .
When variant in defaultProps is solid the above button will use solid variant. Customizing Base Style You can specify the base style of the component and use it across project.
Adding Variants You can also add the variants to the components and use it across project.
NativeBase ships with default styles for each components. . MadeWithNativeBase gluestack-ui |
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |