import { Layout, Playground, Attributes } from 'lib/components'
import { Progress, Spacer, useTheme, Button } from 'components'
import { useState } from 'react'
export const meta = {
title: 'Progress',
description: 'Progress',
}
## Progress
Display progress relative to a limit or related to a task.
`} />
`} />
{
const theme = useTheme()
const [value, setValue] = useState(20)
const colors = {
20: theme.palette.error,
40: theme.palette.warning,
60: theme.palette.success,
80: '#000',
}
return (
<>
>
)
}
`} />
>
`} />
Progress.Props
| Attribute | Description | Type | Accepted values | Default
| ---------- | ---------- | ---- | -------------- | ------ |
| **value** | current value | `number` | - | 0 |
| **max** | max value | `number` | - | 100 |
| **fixedTop** | fix progress to top | `boolean` | - | `false` |
| **fixedBottom** | fix progress to bottom | `boolean` | - | `false` |
| **colors** | custom colors | `{ [key: number]: string }` | - | - |
| **type** | predefined state types | `NormalTypes` | `'default', 'secondary', 'success', 'warning', 'error'` | `default` |
| ... | native props | `ProgressHTMLAttributes` | `'aria-busy', 'className', ...` | - |
export default ({ children }) => {children}