created:7/7/2021
updated:7/7/2021
loc
263
comments
3%
passed
6
failed
6
coverage
66%
Colors
grommet-controls
3.0.2A color selection element, with custom color palettes.
Name | Description | Default |
---|---|---|
colors | Color palette for the user to choose a color from object | - |
color | The default selected color string | - |
onSelect | Called with an object containing the selected color, rowName and colorName (props: { color: string; rowName: string; colorName: string; }) => void | - |
size | What size to make it mediumsmalllarge | medium |
columns | The maximum number of colors per row, if left emty will be calculated automatically number | - |
wrap | If true, will wrap any rows of colors that exceed the columns limit, otherwise will truncate larger rows boolean | - |
package | imports | peer |
---|---|---|
grommet ^2.15.0 | KeyboardBox | * |
grommet/utils/colors ^2.15.0 | normalizeColor | * |
grommet/utils/mixins ^2.15.0 | parseMetricToNum | * |
react ^17.0.1 | ReactComponent | * |
react-dom ^17.0.1 | findDOMNode | * |
styled-components ^5.1.1 | ThemeContext | * |
file | imports |
---|---|
"./StyledColors" | StyledColorsStyledColorStyledColorContainerStyledRowStyledRows |
"./ColorsProps" | IColorsProps |
<StyledRow
keythemestyle
>StyledRow
from"./StyledColors"
<StyledColorContainer
keytheme
>StyledColorContainer
from"./StyledColors"
<StyledColor
refstylesizethemetabIndexa11yTitleplainactivehoverIndicatoronClick
/>StyledColor
from"./StyledColors"
<ThemeContext.Consumer>
styled-components
^5.1.1<StyledColors
sizetheme
>StyledColors
from"./StyledColors"
<Keyboard
onUponDownonLeftonRight
/>grommet
^2.15.0- config
- source
() => (<Box gap="small"><Colorssize="small"colors={{blue,blueGrey,brown,cyan,deepOrange,}}/><Colorssize="medium"columns={5}colors={{blue,blueGrey,brown,cyan,deepOrange,}}/><Colorssize="large"columns={3}colors={{blue,blueGrey,brown,cyan,deepOrange,}}/></Box>)