atomize

repository·master·Indexed 23 days ago

https://github.com/proksh/atomize

A UI design system for React JS providing components for building web applications. Version 1.0.21 supports modern browsers, Internet Explorer 9+, Server-side Rendering (SSR), and Electron. The library includes layout components (Container, Row, Col, Div), form elements (Button, Input, Checkbox), overlays (Modal, SideDrawer, Notification, Dropdown), and a comprehensive SVG icon set.

Tokens
3.2K
Snippets
4
Records
17
Agent score
82%

What's inside atomize

  1. Set up Atomize for local development

    master

    To clone the repository and run the development environment locally:

    1. Clone the repository:
      git clone git@github.com:Proksh/atomize.git
    2. Navigate to the directory:
      cd atomize
    3. Install dependencies:
      npm install // or yarn
    4. Start the development server:
      npm start

    Once started, visit http://localhost:8080 in your browser.

    $ git clone git@github.com:Proksh/atomize.git
    $ cd atomize
    $ npm install // or yarn
    $ npm start
  2. Install Atomize

    master

    To use Atomize in your React project, you must install both atomize and react-transition-group as dependencies.

    Using npm:

    npm install atomize react-transition-group

    Using yarn:

    yarn add atomize react-transition-group
  3. Use Atomize components in React

    master

    After installation, you can import components directly from the atomize package. Here is a basic example of rendering a Button component:

    import { Button } from "atomize";
    ReactDOM.render(<Button />, mountNode);
  4. Use the Modal component

    master

    The Modal component is a React component used to display content in an overlay. It includes a semi-transparent backlayer and automatically manages body scroll behavior (disabling it when open and re-enabling it when closed).

    Props

    PropTypeDefaultDescription
    isOpenbooleanRequiredControls the visibility of the modal.
    onClosefunction() => {}Callback function triggered when the modal overlay is clicked.
    alignstring'start'Alignment for the modal content within the flex container.
    onEnteringfunctionundefinedCallback function executed when the modal begins its entering transition.
    onExitingfunctionundefinedCallback function executed when the modal begins its exiting transition.
    childrenReactNodeRequiredThe content to be rendered inside the modal container.
    ...restobjectN/AAny additional props are passed down to the inner Div container that wraps the children.

    Default Styles for the Inner Container

    When passing extra props via ...rest, the following defaults are applied to the inner content Div:

    • m: { y: { xs: "1rem", lg: "2rem" }, x: { xs: "1rem", lg: "auto" } }
    • p: "2rem"
    • maxW: "32rem"
    • w: "100%"
    • pos: "relative"
    • shadow: "4"
    • cursor: "default"
  5. Use ThemeProvider for theme management

    master
    Wrap your application (or a specific component tree) with ThemeProvider to enable theme-aware styling for atomize components. This allows you to inject custom theme configurations into the component lifecycle.
  6. Use the Notification component

    master

    The Notification component is a React component used to display transient messages. It features built-in entrance and exit transitions and automatically triggers the onClose callback 2000ms after the entering transition completes.

    To control visibility, use the isOpen prop. To handle the component's removal from the UI, provide an onClose function. You can also pass prefix and suffix elements to be rendered around the main content.

  7. Use the SideDrawer component

    master

    The SideDrawer component is a React component used to display a sliding panel (drawer) from the right side of the screen. It includes a semi-transparent backlayer (overlay) that, when clicked, triggers the onClose callback. When the drawer is open, the component automatically disables body scrolling to prevent background scrolling.

    Props

    PropTypeDefaultDescription
    isOpenbooleanRequiredControls the visibility of the drawer.
    onClosefunction() => {}Callback function triggered when the backlayer is clicked.
    onEnteringfunctionundefinedCustom callback triggered when the drawer starts opening.
    onExitingfunctionundefinedCustom callback triggered when the drawer starts closing.
    childrenReactNodeRequiredThe content to be rendered inside the drawer.
    wobject/string{ xs: '100vw', sm: '24rem' }The width of the drawer (supports responsive object syntax).
    bgstring'white'The background color of the drawer content.
    pstring'1.5rem'The padding of the drawer content.
    posstring'relative'The position property for the inner content container.

    Note: The component uses react-transition-group for animations with a fixed duration of 300ms.

  8. Use iconPaths for SVG icon components

    master

    The iconPaths object provides a collection of React components that render SVG <path> elements. Each icon component accepts a color prop to set the fill attribute and allows spreading other standard SVG props (like className, style, or onClick) via a ...rest parameter.

    Commonly available icons include:

    • Add
    • Alert, AlertSolid
    • Attachment
    • Back
    • Bag
    • Behance
    • Bookmark, BookmarkSolid
    • Bulk
    • Camera, CameraSolid
    • Card
    • Checked
    • Close, CloseSolid
    • Coin
    • Cross
    • Delete, DeleteSolid
    • Dot
    • Down, DownArrow, DownArrowCircle, DownArrowSolid
    • Download
    • Draft
    • Dribbble
    • Edit, EditSolid
    • Email
    • Expand
    • External
    • Eye, EyeSolid
    • Facebook
    • Folder, FolderSolid
  9. Import components from the atomize library

    master

    The atomize library provides a collection of UI components (atoms) and utility functions. You can import these directly from the main entrypoint.

    Available components include:

    • Layout & Grid: StyleReset, Container, Row, Col, Div
    • Typography & Content: Text, Image, Tag, Anchor
    • Form Elements: Button, Input, Textarea, Label, Checkbox, Radiobox, Switch
    • Overlays & Navigation: Collapse, Modal, SideDrawer, Notification, Dropdown
    • Icons: Icon (and iconPaths for raw path data)

    Available utility functions:

    • scrollTo: For programmatic scrolling.
    • currentDevice: To detect the current device type.

    Core Providers:

    • ThemeProvider: For managing theme context.
  10. Use Icon and iconPaths in atomize

    master
    The library exports an Icon component for rendering icons and an iconPaths object containing the raw path data for the available icons. Use the Icon component to display visual indicators within your UI.
  11. Use Atomize Icon components

    master
    Atomize provides a collection of React icon components that render SVG <path> elements. Each icon component accepts a color prop to set the fill attribute and spreads other props (...rest) onto the underlying <path> element, allowing for standard SVG attributes like className, style, or onClick.