Closed pdrbrnd closed 2 years ago
Hi!
In reality, headings can't be any any number other than 1 to 6. This small PR makes it possible to use level directly in strongly typed props:
level
const variant = { [1]: 'title', [2]: 'big', [3]: 'body', [4]: 'regular', [5]: 'small', [6]: 'caps', } as const <Text as={`h${level}`} variant={variant[level]}>
Thank you!
Hi!
In reality, headings can't be any any number other than 1 to 6. This small PR makes it possible to use
level
directly in strongly typed props: