emilov2501 / use-ui

Simple React hooks, ready to use, written in TypeScript
MIT License
11 stars 0 forks source link

Request for creating useHeading hook #5

Open emilov2501 opened 6 months ago

emilov2501 commented 6 months ago

I'd like to be able to use a useHeading hook that would include:

sachyshyn commented 6 months ago

@emilov2501 is it the common component for h1-h6 tags? If yes, my proposal is to implement it like this API:

const Heading = useHeading({ props: { level: number from 1 to 6, // default value might be 3 className: string, content: jsx (eventually string) }, additionalProps: { // there should be other possible props like accessibility features or test ids } });

emilov2501 commented 6 months ago

Yeah, sure but also need to include user specific class with classnames, turn on or off ellipsis mode @sachyshyn