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

123
Visualizações
How to add an additional property to antd typography and style it?

I'm using Typography from antd. I found there is a property called type including 'secondary', 'success', 'warning' etc.. But, I would like to use additional custom property called 'heading' too.

import React from 'react';
import PropTypes from 'prop-types';

import Component from './component';

export default function Title(props) {
    return <Component {...props} />;
}
Title.propTypes = {
    code: PropTypes.bool,
    copyable: PropTypes.bool,
    delete: PropTypes.bool,
    disabled: PropTypes.bool,
    editable: PropTypes.bool,
    ellipsis: PropTypes.bool,
    level: PropTypes.oneOf([1, 2, 3, 4, 5]),
    mark: PropTypes.bool,
    onClick: PropTypes.func,
    italic: PropTypes.bool,
    type: PropTypes.oneOf(['secondary', 'success', 'warning', 'danger']),
    underline: PropTypes.bool,
    heading: PropTypes.oneOf([        <<<<----------
        'Main-heading',
        'Sub-heading',
        'Accent-heading',
        'Subscript-heading',
    ]),
};

When I select the one of heading types, the result looks like this. <h1 class="ant-typography" heading="Main-heading">Typography</h1> In this case, how can I change style of the 'heading' element? It is not recognized as class.

about 4 years ago · Juan Pablo Isaza
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