Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

201
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda