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

122
Views
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
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!