Skip to content

Documentation

Qian-Ye_Lin edited this page Apr 11, 2022 · 5 revisions

Welcome to the toshi-nest wiki!

SelectControl

The <SelectControl/> component allows users SINGLE SELECT from a list of options.

Screenshot from 2022-03-29 11-52-29

import React, { useState } from "react";
import { SelectControl } from "@gns-science/toshi-nest";

const SelectControlExample = () => {
  const options = ["1", "2", "3"];

  const [selection, setSelection] = useState(options[0]);

  return (
    <SelectControl selection={selection} options={options} setSelection={setSelection} name={"select control demo}/>
  )
};

props

Prop type
selection string
options string[]
setSelection (selection: string) => void
name string

ControlsBar

The <ControlsBar/> component takes a list of children, displays them with flex with wrapping, and adds margin: 10px to each children.

Screenshot from 2022-03-30 09-49-22

import React from "react";
import { ControlsBar } from "@gns-science/toshi-nest";

const ControlsBarDemo = () => {
  return (
   <ControlsBar>
     <Button1 />
     <Button2 />
   </ControlsBar>
  )
};

MultiSelect

The <MultiSelect/> component allows multiple selections from a list of options.

Screen Shot 2022-03-31 at 10 54 43 AM

import { MultiSelect } from "@gns-science/toshi-nest";

const MultiSelectExample = () => {
  const options = ["1", "2", "3"];

  const [selection, setSelection] = useState(options[0]);

  return (
    <MultiSelect 
      selected={selection} 
      options={options} 
      setOptions={setSelection} 
      name={"MultiSelect"}
    />
  )
};

props

Prop Type
options string[];
selected string[];
setOptions (selections: string[]) => void
name string
Clone this wiki locally