1.0.9 • Published 2 years ago

zebra-block v1.0.9

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Zebra block

  1. Install zebra-block:

    npm install zebra-block
  2. Import component into your project

    import { Zebra } from 'zebra-block';
  3. Usage examples:

// Example 1: Default Zebra Block

<Zebra>
  {/* Any content you want to show inside Zebra Block */}
</Zebra>

// Example 2: Zebra Block with JSON Object

const jsonExample = {
  key: 'value',
  nested: { anotherKey: 'anotherValue' },
};
<Zebra json={jsonExample} />

// Example 3: Zebra Block with Custom Colors

<Zebra colors={['#ff9999', '#ffcc99']}>
  {/* Custom content */}
</Zebra>

// Example 4: Zebra Block with Border and Padding

<Zebra border={2} padding={10}>
  {/* Custom content */}
</Zebra>

// Example 5: Zebra Block with fixed Max Height

<Zebra height={150}>
  {/* Custom content */}
</Zebra>

// Example 6: Zebra Block with Custom Styles

<Zebra style={{ borderRadius: '8px', boxShadow: '0 0 10px rgba(0, 0, 0, 0.2)' }}>
  {/* Custom content */}
</Zebra>

// Example 7: Zebra Block with Custom Element Type

<Zebra as="pre">
  {/* Custom content */}
</Zebra>

// Example 8: Zebra Block with JSON (ignores Children prop)

<Zebra json={jsonExample}>
  {/* This content will be ignored, because JSON prop passed */}
  <p>Custom content</p>
</Zebra>
  1. Props:

    proptypedefaultdescription
    asstring'div'Element type for zebra component
    childrenanyundefinedContent displayed inside zebra (but if you pass Json prop - it preferred by default, and children will be ignored)
    colorstring'#fcfcfc77'color for dashed border if border declared
    bordernumber0number for border in pixels
    colorsstring[]'#fcfcfc77', '#eeeeee77'array of two colours for zebra background gradient
    paddingnumberundefinedZebra padding
    heightnumberundefinedmaxHeight value for zebra
    style{}{}any other styles you want to define for zebra
    json{}nullJson object you can display inside of zebra
  2. Development:

    • Run the Storybook for local development:

      npm run storybook

      Explore existing examples in Storybook and add your own stories to showcase different features or use cases for the Zebra block component.

Contributing

This project is open for improvements and maintenance. Feel free to fork and make your own modifications.

License

MIT

1.0.9

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago