Develop ultra fast with Prismane 🎉

Style Props

All of Prismane's components have a set of props that help with faster development speeds and ease of use.

import { Box, fr } from "@prismane/core";

const Page = () => {
  return (
    <Box
      w={fr(5)}
      h={40}
      bg={[["primary", 600], { hover: "base", active: ["primary", 700] }]}
      op={(theme) => (theme.mode === "dark" ? 0.2 : 0.5)}
      cs="pointer"
    >
      Hello, world
    </Box>
  );
};

export default Page;

Style Prop Structure

Our style props are able to be provided pseudo class support or just a single value. All of our props have access to the current theme object, by providing them as a function:

Single Value:

import { Box } from "@prismane/core";

const Page = () => {
  return <Box w={20}>Hello, world</Box>;
};

export default Page;

Pseudo Class:

import { Box } from "@prismane/core";

const Page = () => {
  return <Box w={[20, { hover: 40 }]}>Hello, world</Box>;
};

export default Page;

With Theme Object:

import { Box } from "@prismane/core";

const Page = () => {
  return (
    <Box w={(theme) => (theme.mode === "dark" ? 20 : 40)}>Hello, world</Box>
  );
};

export default Page;

Supported Props

This is a list of all of Prismane's supported style props and their custom values, provided they have any:

PropCSS Property NameAdditional Values
wwidth-
hheight-
mmargin-
mymargin-top + margin-bottom-
mxmargin-left + margin-right-
mtmargin-top-
mrmargin-right-
mbmargin-bottom-
mlmargin-left-
ppadding-
pypadding-top + padding-bottom-
pxpadding-left + padding-right-
ptpadding-top-
prpadding-right-
pbpadding-bottom-
plpadding-left-
clcolorPrismane Colors And Shades
bgbackground-colorPrismane Colors And Shades
brborder-radius- xs: 2px
- sm: 4px
- base: 6px
- md: 8px
- lg: 12px
- xl: 16px
- 2xl: 24px
- full: 9999px
mihmin-height-
mahmax-height-
miwmin-width-
mawmax-width- xs: 320px
- sm: 384px
- base: 448px
- md: 512px
- lg: 576px
- xl: 672px
- 2xl: 768px
- 3xl: 896px
- 4xl: 1024px
- 5xl: 1152px
- 6xl: 1280px
opopacity-
posposition-
ttop-
rright-
bbottom-
lleft-
dpdisplay-
zz-index-
ofoverflow-
fffont-family-
fsfont-size-
fwfont-weight-
lsletter-spacing-
tatext-align-
lhline-height-
tttext-transform-
tdtext-decoration-
bdborder-
bdwborder-width-
bdsborder-style-
bdcborder-colorPrismane Colors And Shades
bdtborder-top-
bdtwborder-top-width-
bdtsborder-top-style-
bdtcborder-top-colorPrismane Colors And Shades
bdrborder-right-
bdrwborder-right-width-
bdrsborder-right-style-
bdrcborder-right-colorPrismane Colors And Shades
bdbborder-bottom-
bdbwborder-bottom-width-
bdbsborder-bottom-style-
bdbcborder-bottom-colorPrismane Colors And Shades
bdlborder-left-
bdlwborder-left-width-
bdlsborder-left-style-
bdlcborder-left-colorPrismane Colors And Shades
bdxborder-left + border-right-
bdxwborder-left-width + border-right-width-
bdxsborder-left-style + border-right-style-
bdxcborder-left-color + border-right-colorPrismane Colors And Shades
bdyborder-top + border-bottom-
bdywborder-top-width + border-bottom-width-
bdysborder-top-style + border-bottom-style-
bdycborder-top-color + border-bottom-colorPrismane Colors And Shades
ftfilter-
bftbackdrop-filter-
tshtext-shadow-
bshbox-shadow- xs: 0 1px 2px 0 rgb(0 0 0 / 0.05)
- sm: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)
- base: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)
- md: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)
- lg: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)
- xl: 0 25px 50px -12px rgb(0 0 0 / 0.25)
- inner: inset 0 2px 4px 0 rgb(0 0 0 / 0.05)
pepointer-events-
cscursor-
bsbox-sizing-

Prismane Colors and Shades

Every style prop that supports the Prismane Colors and Shades has the ability to use Prismane's colors as well as theme colors and their respective shades:

Single Value:

import { Box } from "@prismane/core";

const Page = () => {
  return (
    <>
      <Box bg="diamond">Hello, world</Box> // Prismane Color
      <Box bg="primary">Hello, world</Box> // Theme Color
      <Box bg={(theme) => (theme.mode === "dark" ? "primary" : "base")}>
        Hello, world
      </Box>
      <Box bg={["primary", { hover: "base" }]}>Hello, world</Box> // Pseudo Class
      <Box bg="#ffffff">Hello, world</Box> // Custom Color
    </>
  );
};

export default Page;

Important

When providing only the name of the color, without a specific shade, by default we get the 500 shade, unless it is a custom color!

With Shade:

When providing a color with a specific shade, we provide an array. The first cell of the array is the color name and the second is the shade.

import { Box } from "@prismane/core";

const Page = () => {
  return (
    <>
      <Box bg={["diamond", 300]}>Hello, world</Box> // Prismane Color
      <Box bg={["primary", 300]}>Hello, world</Box> // Theme Color
      <Box
        bg={(theme) => (theme.mode === "dark" ? ["red", 300] : ["red", 600])} // With Theme Object
      >
        Hello, world
      </Box>
      <Box bg={[["primary", 600], { hover: ["base", 700] }]}>Hello, world</Box>
    </>
  );
};

export default Page;