# Plain [hidden]

Host: No library. Path: transitions. Preset: `scale-fade`.

A div and one attribute. No framework, no JavaScript animation, no wrapper component.

The page this file mirrors mounts the component twice, once with the attribute and once without, so the only difference between the two is the library.

Upstream documentation: [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Global_attributes/hidden)

Only in No library. No other host here implements this component.

## Where the attribute goes

The parts this demo composes, and the value each one carries. Everything inside an animated part is that part's content, so the tree stops there.

```text
button
div  data-motion="scale-fade"
```

## How the match works

| Step | Value |
| --- | --- |
| host writes | `[hidden]` |
| easeful matches | `[data-motion~="scale-fade"][hidden]` |
| what runs | `transition: opacity, scale, display` |
| you write | `<div hidden data-motion="scale-fade">` |

## Every value that works here

Every value the manifest allows on this host, single presets and the pairs that compose. The first is what this component ships with. Both stages are the same component, so anything that changes between them is the attribute.

| Value | Link |
| --- | --- |
| `scale-fade` | the default |
| `fade` | [fade](/native/hidden#motion=fade) |
| `slide-up` | [slide-up](/native/hidden#motion=slide-up) |
| `fade slide-up` | [fade slide-up](/native/hidden#motion=fade%20slide-up) |
| `scale-fade slide-up` | [scale-fade slide-up](/native/hidden#motion=scale-fade%20slide-up) |

## Source

`apps/docs/components/demos/native/hidden.tsx`

```tsx
"use client"

import { useState } from "react"
import type { DemoProps } from "@/components/demos/props"

export function PlainHidden({ motion }: DemoProps) {
  const [open, setOpen] = useState(false)

  return (
    <>
      <button type="button" className="btn" onClick={() => setOpen((v) => !v)}>
        {open ? "Hide panel" : "Show panel"}
      </button>
      <div className="panel" data-motion={motion} hidden={!open} style={{ marginTop: 12 }}>
        <p className="panel__title">A div and one attribute</p>
        <p className="panel__body">
          No framework, no JavaScript animation, no wrapper component. Toggling hidden is the
          entire integration.
        </p>
      </div>
    </>
  )
}
```
