2.1.7 • Published 4 years ago

@colisweb/bs-chakra-ui v2.1.7

Weekly downloads
22
License
MIT
Repository
-
Last release
4 years ago

bs-chakra-ui 🚧

Bucklescript bindings for chakra-ui.

Important note, chakra-ui use the styled system but in order to avoid props bindings overhead, I decided to mainly use <Box /> when I need to create space, etc.

Install

yarn add @colisweb/bs-chakra-ui

Add it to bs-dependencies in your bsconfig.json :

{
  "bs-dependencies": ["@colisweb/bs-chakra-ui"]
}

Example

open BsChakra;

module App = {
  [@react.component]
  let make = () => {
    let (isChecked, setChecked) = React.useState(() => false);

    <ThemeProvider theme>
      <CSSReset />
      <Text fontSize={Responsive([|`center, `right, `left|])}>
        "Hello responsive"->React.string
      </Text>
      <Stack isInline=true align=`center spacing=2>
        <FormLabel htmlFor="toggle">
          <Text fontSize={All(`center)}>
            "Toggle"->React.string
          </Text>
        </FormLabel>
        <Switch
          id="toggle"
          size=`lg
          isChecked
          onChange={_ => setChecked(v => !v)}
        />
      </Stack>
    </ThemeProvider>
  };
};

Todo

  • Accordion
  • Alert
  •   AspectRatioBox
  • Avatar
  •   Badge
  • Box 🚧
  •   Breadcrumb
  • Button 🚧
  •   Checkbox
  • CircularProgress
  • CloseButton
  • Code
  • Collapse
  • ControlBox
  • Drawer
  • Editable
  • Flex
  • FormControl
  • FormHelperText
  • FormErrorMessage
  • Heading
  • Icon
  • IconButton
  • Image
  • Input
  • Link
  • List
  • Modal
  • Menu
  • NumberInput
  • Popover
  • Progress
  • PseudoBox
  • Radio
  • Slider
  • Spinner
  • Stat
  • Stack
  • Switch
  • Tabs
  • Tag
  • Textarea
  • Text
  • Toast
  • Tooltip
  • useClipboard
  • useDisclosure
  • useTheme

Add Box and PseudoBox props automatically

Box

// use-make-box
[@bs.module "@chakra-ui/core"] [@react.component]
external make: (~some: bool=?) => React.element = "Tabs";

// use-makeProps-box
let makeProps = (~some: option(bool)=?) =>
  makeProps(~some=?some->Belt.Option.map(v => true));

PseudoBox

// use-make-pseudoBox
[@bs.module "@chakra-ui/core"] [@react.component]
external make: (~some: bool=?) => React.element = "Tabs";

// use-makeProps-pseudoBox
let makeProps = (~some: option(bool)=?) =>
  makeProps(~some=?some->Belt.Option.map(v => true));

Transform

yarn tansform
2.1.7

4 years ago

2.1.6

4 years ago

2.1.5

4 years ago

2.1.4

4 years ago

2.1.3

4 years ago

2.1.2

4 years ago

2.1.1

4 years ago

2.0.10

4 years ago

2.1.0

4 years ago

2.0.9

4 years ago

2.0.8

4 years ago

2.0.7

4 years ago

2.0.6

4 years ago

2.0.5

4 years ago

2.0.4

4 years ago

2.0.3

4 years ago

2.0.2

4 years ago

2.0.1

4 years ago

2.0.0

4 years ago

0.8.1

5 years ago

0.8.0

5 years ago