Bleed

Lets content reach past its container's padding, such as an image that runs to the edge of a card.

Usage

Spacing props take a positive amount.

Code
import { Bleed, Box } from '@leverui/components';

export function BleedUsage() {
  return (
    <Box class="bleed-usage-card">
      <Bleed inline="10">
        <Box class="bleed-usage-surface">Bleed</Box>
      </Bleed>
    </Box>
  );
}
Code
/* bleed-usage.css */
.bleed-usage-card {
  padding: var(--leverui-spacing-10);
  border-width: 1px;
}

.bleed-usage-surface {
  display: grid;
  place-items: center;
  min-height: var(--leverui-sizes-20);
  background: var(--leverui-colors-bg-emphasized);
}

Examples

Vertical

Use the block prop to make the element bleed vertically.

Specific Direction

Use the inlineStart, inlineEnd, blockStart, and blockEnd props to make the element bleed in a specific direction.

Props

PropTypePurpose
inlineSpacing value or responsive valueExtend past both inline edges, usually left and right.
blockSpacing value or responsive valueExtend past both block edges, usually top and bottom.
inlineStartSpacing value or responsive valueExtend past the inline-start edge. Left in left-to-right.
inlineEndSpacing value or responsive valueExtend past the inline-end edge. Right in left-to-right.
blockStartSpacing value or responsive valueExtend past the block-start edge, usually the top.
blockEndSpacing value or responsive valueExtend past the block-end edge, usually the bottom.
asNative HTML tagHTML tag to render.
asChildRender callbackRender your own element with Bleed's props.
unstyledBooleanTurn off the default styles. The spacing you set still applies.

Match the parent's padding to reach its edge. Start and end props follow the text direction. Style with .leverui-bleed, or pass class and style.