[react] feat: Added docs for components/Number
This commit is contained in:
parent
062eb497e9
commit
fa5bad3d07
4 changed files with 46 additions and 5 deletions
|
@ -1,10 +1,19 @@
|
|||
import React from 'react'
|
||||
|
||||
/**
|
||||
* A component to display a number or character inside a circle
|
||||
*
|
||||
* @component
|
||||
* @param {object} props - All component props
|
||||
* @param {number|string} props.nr - The number to display
|
||||
* @param {string} [props.color = secondary] - One of the DaisyUI color names
|
||||
* @returns {JSX.Element}
|
||||
*/
|
||||
export const NumberCircle = ({ nr, color = 'secondary' }) => (
|
||||
<span
|
||||
className={`p-2 w-8 h-8 flex flex-col items-center justify-center shrink-0 rounded-full text-center p-0 py-2 bg-${
|
||||
className={`tw:p-2 tw:w-8 tw:h-8 tw:flex tw:flex-col tw:items-center tw:justify-center tw:shrink-0 tw:rounded-full tw:text-center tw:p-0 tw:py-2 tw:bg-${
|
||||
color
|
||||
} text-${color}-content border-2 border-base-100`}
|
||||
} tw:text-${color}-content tw:border-2 tw:border-base-100`}
|
||||
>
|
||||
{nr}
|
||||
</span>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue