@chakra-ui/react APIs
- Button
- Box
- ChakraProvider
- Text
- Flex
- Input
- Stack
- useDisclosure
- ModalOverlay
- ModalContent
- ModalBody
- Image
- Modal
- ModalCloseButton
- Heading
- IconButton
- ModalHeader
- extendTheme
- HStack
- Link
- Divider
- Tooltip
- SimpleGrid
- Spinner
- ModalFooter
- Center
- Table
- FormControl
- FormLabel
- useToast
- useColorMode
- InputGroup
- VStack
- Icon
- Select
- Menu
- MenuButton
- MenuList
- MenuItem
- Badge
- ListItem
- Thead
- Tr
- Th
- Tbody
- Td
- Container
- Alert
- useColorModeValue
- Spacer
- Tabs
- TabList
- Tab
- TabPanels
- TabPanel
- Skeleton
- Tag
- Avatar
- Textarea
- SkeletonText
- InputLeftElement
- Grid
- DrawerBody
- DrawerContent
- DrawerCloseButton
- DrawerHeader
- DrawerOverlay
- AspectRatio
- theme
- SkeletonCircle
- UnorderedList
- Code
- ButtonGroup
- PopoverTrigger
- Popover
- PopoverContent
- PopoverBody
- CSSReset
- Drawer
- DrawerFooter
- List
- FormHelperText
- InputRightElement
- Collapse
- AlertIcon
- Switch
- Stat
- StatLabel
- StatNumber
- ColorModeScript
- useClipboard
- Checkbox
- LinkBox
- LinkOverlay
- PopoverArrow
- PopoverHeader
- useTheme
- InputRightAddon
- keyframes
- useBreakpointValue
- StackDivider
- SliderTrack
- SliderFilledTrack
- SliderThumb
- Radio
- RadioGroup
- StatGroup
- OrderedList
- MenuDivider
- FormErrorMessage
- CloseButton
- useMediaQuery
- AlertTitle
- AlertDescription
- Accordion
- AccordionItem
- AccordionButton
- AccordionIcon
- AccordionPanel
- PopoverCloseButton
- GridItem
- ThemeProvider
- Progress
- useRadio
- useRadioGroup
- useBreakpoint
- Slider
- CircularProgress
- ColorModeProvider
- cookieStorageManager
- localStorageManager
- useBoolean
- AlertDialog
- AlertDialogBody
- AlertDialogCloseButton
- AlertDialogContent
- AlertDialogFooter
- AlertDialogHeader
- AlertDialogOverlay
- NumberInputField
- NumberInput
- useTab
- FormErrorIcon
- VisuallyHiddenInput
- Portal
- useToken
- useInterval
- VisuallyHidden
- Wrap
- WrapItem
- createIcon
- PopoverFooter
- AvatarBadge
- chakra
- forwardRef
- TableCaption
- Breadcrumb
- Kbd
- createStandaloneToast
OtherRelated APIs
- react#useState
- react-i18next#useTranslation
- react-query#useQuery
- react-query#useMutation
- react-query#useQueryClient
- react-query#useQueries
- @chakra-ui/react#Flex
- @chakra-ui/react#DrawerContent
- @chakra-ui/react#DrawerCloseButton
- @chakra-ui/react#DrawerOverlay
- @chakra-ui/react#Modal
- @chakra-ui/react#ModalOverlay
- @chakra-ui/react#ModalContent
- @chakra-ui/react#ModalHeader
- @chakra-ui/react#ModalCloseButton
- @chakra-ui/react#Code
- @chakra-ui/react#Alert
- @chakra-ui/react#AlertIcon
- @chakra-ui/react#useInterval
- @chakra-ui/react#AlertTitle
- @chakra-ui/react#AlertDescription
@chakra-ui/react#useToken JavaScript Examples
The following examples show how to use
@chakra-ui/react#useToken.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: hooks.js From idena-web with MIT License | 6 votes |
export function useAdStatusColor(status, fallbackColor = 'muted') {
const statusColor = {
[AdRotationStatus.Showing]: 'green',
[AdRotationStatus.NotShowing]: 'red',
[AdRotationStatus.PartiallyShowing]: 'orange',
}
const color = useToken('colors', `${statusColor[status]}.500`, fallbackColor)
return color
}
Example #2
Source File: components.js From idena-web with MIT License | 6 votes |
export function Select(props) {
const iconSize = useToken('space', '5')
return (
<ChakraSelect
icon={<ChevronDownIcon />}
iconColor="muted"
iconSize={iconSize}
borderColor="gray.100"
fontSize="md"
lineHeight="short"
h={8}
_placeholder={{
color: 'muted',
}}
_disabled={{
bg: 'gray.100',
color: 'muted',
}}
{...props}
/>
)
}