Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

191
Views
Is there a way to override all base defaultProps at once in NativeBase components?

New to NativeBase and using version 3.4.1.

We're quickly finding that we prefer the "xl" size for icons and text.
Is there an easier way to set all font sizes to xl without overriding every single component?

Currently we're following the docs and overriding defaultProps like this...

import { extendTheme } from 'native-base';

export const ExtendedNativeBaseTheme = extendTheme({
  
  components: {
    Button: {
      defaultProps: {
        size: 'xl',
      },
    },
    Checkbox: {
      defaultProps: {
        _text: {
          fontSize: 'xl',
        },
      },
    },
    Input: {
      defaultProps: {
        size: 'xl',
      },
    },
    Icon: {
      defaultProps: {
        size: 'xl',
      },
    },
    IconButton: {
      defaultProps: {
        _icon: {
          size: 'xl',
        },
      },
    },
    Text: {
      defaultProps: {
        fontSize: 'xl',
      },
    },
  },
});
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

The withDefaultSize Theme Extension is what you want.

Modifying the example from their docs:

import { extendTheme, withDefaultSize } from '@chakra-ui/react'

const customTheme = extendTheme(
  withDefaultSize({
    size: 'xl',
    components: ['Button', 'Checkbox', 'Icon', ...],
  }),
)

All you would need to do is to list all components that need size xl in the components property

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!