# New Firewall Rule block

> New firewall rule sheet with a condition builder and live match preview against recent traffic

WAF and edge rule create form: IP, country, ASN, path, bot score and rate conditions, a live expression, and Block, Challenge, Allow or Log actions. ReUI Filters, CodeBlock, Frame; shadcn Sheet, RadioGroup, Select. Security rules, access control.

- Type: Pro block
- Category: [Sheet](https://web.dev.reui.io/blocks/application/sheet.md)
- Page: https://web.dev.reui.io/blocks/application/sheet/sheet-17
- Docs (Base UI): https://ui.shadcn.com/docs/components/base/sheet.md
- Docs (Radix UI): https://ui.shadcn.com/docs/components/radix/sheet.md
- MCP: `get_block("sheet-17")`
- Built with: Badge, Button, Code Block, Field, Filters, Frame, Input, Radio Group, Select, Sheet, Switch, Tooltip
- Installs with a ReUI Pro or Ultimate license; setup: https://web.dev.reui.io/docs/license-setup

## Best for

A blank rule with a live count of recent requests it would match, 4 preview rows, an expiry and top or bottom placement in the rule order

## Agent notes

- The match preview filters `recent`, built by `seedTraffic` from `REQUEST_TEMPLATES`; pass your real recent request log instead
- Create Rule only runs `createRule`, which dispatches to `firewallReducer` and shows a toast; send the draft to your API there
- `RULE_FIELDS` builds its country, service and list options from `COUNTRIES`, `SERVICES` and `MANAGED_LISTS`; swap in your own fields

## When not to use

- Changing a saved rule that has hits, matched log events and a Delete button: use [Edit Firewall Rule](https://web.dev.reui.io/blocks/application/sheet/sheet-18.md) (`get_block("sheet-18")`)
- A condition builder on its own, with no sheet, form or footer around it: use [Filters](https://web.dev.reui.io/components/filters.md) (`get_component("filters")`)

## Third-party libraries

- Sonner v2: [API reference](https://sonner.emilkowal.ski/toast), [docs](https://sonner.emilkowal.ski/getting-started)
- Shiki v4: [API reference](https://shiki.style/guide/install), [docs](https://shiki.style/guide/), through ReUI Code Block

## Install

```bash
npx shadcn@latest add @reui/sheet-17
```

## About Sheet blocks

### When to use

- Record detail opened over a list or table: a ticket, metric, cron job, audit event, deploy, SLO or data source
- Create and edit forms in a side panel for a project, cron job, firewall rule, SLO or data connection
- Utility panels for help guides, keyboard shortcuts, an AI assistant, comments, notifications or view settings

### When not to use

- A bare side panel with your own header, body and footer, nothing prebuilt: use [Sheet](https://web.dev.reui.io/components/sheet.md) (`get_component("sheet")`)
- A persistent sidebar or navigation layout that stays around every page: use the [App Shell blocks](https://web.dev.reui.io/blocks/application/app-shell.md)
- An assistant conversation that fills the whole page rather than a side panel: use the [AI Chat blocks](https://web.dev.reui.io/blocks/ai-agents/ai-chat.md)

### Agent notes

- Each root renders a demo `SheetTrigger` button and opens on mount via `defaultOpen` or a `useState` seeded true; start it closed in your app
- Each `SheetContent` className floats it inset with `inset-y-4`, `right-4` and `rounded-xl` and sets its own width; resize it there, not in the primitive
- Each page.tsx only centers the trigger in a `min-h-svh` main with an `sr-only` h1; render the root component alone inside your page

Every ReUI item has a twin like this one; the index is https://web.dev.reui.io/llms.txt. Agents with the ReUI MCP (https://web.dev.reui.io/docs/mcp) get the same guidance from the getters named above.
