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

377
Visualizações
RN: wrap buttons when a big font size

I have two buttons in a row. When increasing the font size the text leaves for the next line. Is it possible to wrap the buttons when the font size is increased? I'm trying to set flex: 1 1 50% and min-width for buttons and flex-direction: row; flex-wrap: wrap; align-items: center; for container, but that wrapping for default font size and increasing.

Button size prop: width: ${props => props.size === 'normal' || props.size === 'large' ? '100%' : null};

Default font size:

enter image description here

Increasing the font size in settings:

enter image description here

Wrapping with default and increasing:

enter image description here

enter image description here

<styled.Container>
  <styled.ButtonWrap>
    <Button size='minimal' style={{ alignItems: 'center' }} title='Inapoi' type='secondary' />
  </styled.ButtonWrap>
  <styled.ButtonWrap>
    <Button size='minimal' style={{ alignItems: 'center' }} title='Urmatorul' />
  </styled.ButtonWrap>
</styled.Container>
export const Container = styled.View`
  margin-top: 8px;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  background-color: #fa755a;
`;

export const ButtonWrap = styled.View`
  flex: 1 1 50%;
  min-width: 198px;
  margin-left: 8px;
  margin-right: 8px;
  margin-top: 6px;
  background-color: #0db41b;
`;

UPD: Resolved with

export const ButtonWrap = styled.View`
  flex: auto;
  margin-top: 6px;
  margin-left: 8px;
  margin-right: 8px;
  min-width: 162px;
`;

export const Container = styled.View`
  flex-flow: wrap;
  margin-top: 8px;
  align-items: center;
`;
about 4 years ago · Juan Pablo Isaza
2 Respostas
Responde à pergunta

0

You didn't actually set the display from Container to flex. IF you add the following to Container, you should be okay.

display: flex;

Otherwise, you can always use inline-block, which has auto wrapping. The only thing you have to do is to set margin: auto to center the items.

about 4 years ago · Juan Pablo Isaza Relatório

0

Resolved with:

export const ButtonWrap = styled.View`
  flex: auto;
  margin-top: 6px;
  margin-left: 8px;
  margin-right: 8px;
  min-width: 162px;
`;

export const Container = styled.View`
  flex-flow: wrap;
  margin-top: 8px;
  align-items: center;
`;
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