Skip to content
Brok UI

Loading…

No results

Bleed

Open source

A controlled full-bleed primitive for tables, code, and media, with an optional contained horizontal scroll mode.

Version
v1.1.5
Stability
stable
License
MIT
Related
Container
Surface
Cluster

Preview

Wide content scrolls inside the bleed region without widening the page.
Size
previews.components.bleed.default.blade.php Blade
<x-ui.surface class="w-full max-w-md">
    <x-ui.bleed scroll>
        <div class="min-w-2xl rounded-md bg-muted p-4 text-sm text-muted-foreground">
            {{ __('Wide content scrolls inside the bleed region without widening the page.') }}
        </div>
    </x-ui.bleed>
</x-ui.surface>
4 Current
6 Current
8 Current
Sm Current
Md Current
Lg Current

Installation

terminal
php artisan ui:add bleed

Registry contract

php artisan ui:add bleed writes only the files below. The CLI validates each file hash before writing and asks before it replaces a local change, unless you pass --force.

  • blade resources/views/components/ui/bleed.blade.php
Registry dependencies
None — installs on its own.
Packages
composer: jml/brok:^0.2

Use with AI

A brief for your coding agent: install command, usage, props, guidance and the rules. Copy it, or open a prompt about this component in an assistant.

bleed.md
# Brok UI: Bleed (`bleed`)

A controlled full-bleed primitive for tables, code, and media, with an optional contained horizontal scroll mode.

Brok UI is a Laravel Blade component registry. Installed components are plain Blade files the app owns.

## Install

```bash
php artisan ui:add bleed
```

## Usage

```blade
<x-ui.surface class="w-full max-w-md">
    <x-ui.bleed scroll>
        <div class="min-w-2xl rounded-md bg-muted p-4 text-sm text-muted-foreground">
            {{ __('Wide content scrolls inside the bleed region without widening the page.') }}
        </div>
    </x-ui.bleed>
</x-ui.surface>
```

## Props

- `size` (6|4|8|sm|md|lg, default `6`) — Negative margin and matching inner padding step: 4, 6, 8, or the gutter tokens sm/md/lg.
- `scroll` (bool, default `false`) — When true, the bled region becomes a horizontally scrollable, keyboard-focusable strip instead of overflowing visually.
- `as` (string, default `div`) — HTML tag to render: div, section, main, or aside.

## Use when

- Use to structure hierarchy, spacing, and responsiveness so content is easier to scan and navigate.
- Letting a table, code block, or media item extend to the container's outer edge inside an otherwise padded parent.
- Needing a scrollable full-width strip (with scroll) that still respects the surrounding gutter's padding.

## Avoid when

- Do not let layout primitives substitute for semantics, headings, or interaction rules users still need.
- The content already fits inside the parent's padding; a bleed adds negative margin with no visual benefit.
- Building a general horizontal-scroll container unrelated to a parent's gutter; compose overflow-x-auto directly.

## Anti-patterns

- Using visual layout as a substitute for semantic structure

## Rules

- Use the `<brok:bleed>` tag (or `<x-ui.bleed>`) in Blade; do not rewrite the component.
- Prefer the documented props and variants over utility-class overrides; when a utility must win, use the `!` important modifier.
- Use semantic design tokens (`bg-primary`, `text-muted-foreground`), never raw colour utilities.
- Keep the `data-slot` attributes; they are the styling and test hooks.

## Links

- Docs: https://brokui.dev/docs/components/bleed
- Registry JSON (files, props, contract): https://brokui.dev/r/open/bleed.json

Working in Claude Code, Cursor or Codex? Give the agent the whole registry through the MCP server or the Brok UI skill.

API

manifest knowledge + registry-derived coverage

Props

Props accepted by this component: name, type, default value and description.
Prop Type Default Description
size 6 | 4 | 8 | sm | md | lg 6 Negative margin and matching inner padding step: 4, 6, 8, or the gutter tokens sm/md/lg.
scroll bool false When true, the bled region becomes a horizontally scrollable, keyboard-focusable strip instead of overflowing visually.
as string div HTML tag to render: div, section, main, or aside.

Slots

  • default — Content that bleeds to the container's outer edge.

Renders as div, section, main, aside.

Data slots

Stable hooks for CSS overrides and browser tests.

bleed

Behavior

  • Applies a negative margin equal to size and matching inner padding, so the content's own edge lines up with the container's outer edge.
  • With scroll enabled, the element also becomes a tabbable scroll container (tabindex="0" unless the consumer supplies one) so keyboard users can scroll it.
  • Declares registry capability flags: a11y, responsive, rtl, darkMode, localized.

Guidance

Layout and content structure

Structure content hierarchy and responsive relationships.

Use when

  • Use to structure hierarchy, spacing, and responsiveness so content is easier to scan and navigate.
  • Letting a table, code block, or media item extend to the container's outer edge inside an otherwise padded parent.
  • Needing a scrollable full-width strip (with scroll) that still respects the surrounding gutter's padding.

Avoid when

  • Do not let layout primitives substitute for semantics, headings, or interaction rules users still need.
  • The content already fits inside the parent's padding; a bleed adds negative margin with no visual benefit.
  • Building a general horizontal-scroll container unrelated to a parent's gutter; compose overflow-x-auto directly.

Use instead

  • Semantic HTML with standard flow

Anti-patterns

  • Using visual layout as a substitute for semantic structure
Anatomy
root
Theming hooks
bleed

Accessibility

WCAG 2.2 AA Keyboard focus-visible RTL-ready Localized labels Dark mode
Keyboard
No component-owned keyboard interaction; native element behavior applies.
Focus
none
  • With scroll enabled, the region is keyboard-focusable so users who cannot use a pointer or trackpad can still scroll its content.
  • Semantic HTML and a stable data-slot attribute for styling and scripting hooks.
  • Focus-visible rings use the ring token, so keyboard focus is always visible.
  • Disabled and invalid states are conveyed to assistive tech, not by color alone.
  • Targets WCAG 2.2 AA; verify contrast in light, dark, admin and customer surfaces in the preview.
  • Labels go through __() and layout uses logical properties (ms-*, text-start), so it mirrors under dir="rtl" — flip the preview to RTL to confirm.
  • Dark mode uses the same semantic tokens under the dark class; high contrast follows forced-color system tokens.

Livewire

Safe

Livewire can update this component through forwarded wire:* attributes.

Source

The exact, editable file ui:add writes into your app. Previews render this same code; there are no preview-only components.

resources/views/components/ui/bleed.blade.php Blade
@props([
    'size' => '6',
    'scroll' => false,
    'as' => 'div',
])

@php
    $allowedTags = ['div', 'section', 'main', 'aside'];
    $tag = in_array($as, $allowedTags, true) ? $as : 'div';
    $sizes = [
        '4' => '-mx-4 px-4',
        '6' => '-mx-6 px-6',
        '8' => '-mx-8 px-8',
        'sm' => '-mx-gutter-sm px-gutter-sm',
        'md' => '-mx-gutter-md px-gutter-md',
        'lg' => '-mx-gutter-lg px-gutter-lg',
    ];
    $sizeKey = array_key_exists((string) $size, $sizes) ? (string) $size : '6';
@endphp

<{{ $tag }}
    data-slot="bleed"
    data-size="{{ $sizeKey }}"
    data-scroll="{{ $scroll ? 'true' : 'false' }}"
    @if ($scroll && ! $attributes->has('tabindex')) tabindex="0" @endif
    {{ $attributes->merge(['class' => trim('min-w-0 max-w-full '.$sizes[$sizeKey].' '.($scroll ? 'overflow-x-auto overscroll-x-contain' : ''))]) }}
>{{ $slot }}</{{ $tag }}>

Ownership & lifecycle

Owner, release state, review evidence and adoption for this item.
Owner
Platform UI (@JoshJML)
Current version
1.1.5
Status
Stable
License
open
Accessibility reviewed
No review date recorded
Last breaking change
No date recorded
Deprecation
Not deprecated
Contract
v6
Foundation
≥ 1.0.0