React Components for Dummies


Radio


<Radio
  value={value}
  onChange={e => setValue(e.currentTarget.value)}
  name="number"
>
  default
</Radio>


Radio Props

NameTypeDescription
namestringThe name attribute specifies the name of an input element.
onChangefunctionHandler for change events on trigger element.
valuestringPassed to the input element value attribute

Pagination


<Paginate
   forcePage={0}
   onPageChange={(selected)=>console.log(selected)}
   pageCount={42 / 12}
/>


Pagination Props

NameTypeDescription
forcePagenumberSelect current page number
onPageChangefunctionHandler for change events on trigger element.
pageCountnumbertotal number of element / limit

Empty View


Sorry! No Data Found.

Write somthing ....




<EmptyView message="Write somthing ...." />




Props

NameTypeDescription
messagestring

Popover


<Popover
    placement="bottom-start"
    renderReference={(ref, toggle) => (
        <button
          onClick={() => toggle()}
          ref={ref}
        >
         Trigger
        </button>
    )}
    renderPopover={(toggle) => {
        return (
            <div
            style={{
                background: "gray",
                height: "100px",
                width: "200px",
                display: "flex",
                alignItems: "center"
            }}
            >
            <p
                style={{
                color: "white",
                padding: "12px"
                }}
            >
                Content
            </p>
            <button onClick={toggle}>close</button>
            </div>
        );
    }}
/>


Popover Props

NameTypeDescription
placementstring"auto" | "auto-start" | "auto-end" | "top" | "top-start" | "top-end" | "bottom" | "bottom-start" | "bottom-end" | "right" | "right-start" | "right-end" | "left" | "left-start" | "left-end
renderReferencereact nodeThe content that will trigger the popover.
renderPopoverreact nodecontent of popover
portalbooleanopen content outside of root div
zIndexnumberby default it is 60