Skip to content

Commit

Permalink
add docs on search button
Browse files Browse the repository at this point in the history
  • Loading branch information
timlrx committed Jul 30, 2023
1 parent 00c7ebb commit 71451a3
Showing 1 changed file with 54 additions and 0 deletions.
54 changes: 54 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,33 @@ export default function Layout() {
}
```

Use `KBarButton` to add a button which toggles the command palette on click event.

```tsx
import { KBarButton } from 'pliny/search/KBarButton'

export default function SearchButton() {
return (
<KBarButton aria-label="Search Content">
<svg
xmlns="http://www.w3.org/2000/svg"
fill="none"
viewBox="0 0 24 24"
strokeWidth={1.5}
stroke="currentColor"
className="w-6 h-6"
>
<path
strokeLinecap="round"
strokeLinejoin="round"
d="M21 21l-5.197-5.197m0 0A7.5 7.5 0 105.196 5.196a7.5 7.5 0 0010.607 10.607z"
/>
</svg>
</KBarButton>
)
}
```

#### Algolia

```tsx
Expand All @@ -281,6 +308,33 @@ export default function Layout() {
}
```

Use `AlgoliaButton` to add a button which toggles the command palette on click event.

```tsx
import { AlgoliaButton } from 'pliny/search/AlgoliaButton'

export default function SearchButton() {
return (
<AlgoliaButton aria-label="Search Content">
<svg
xmlns="http://www.w3.org/2000/svg"
fill="none"
viewBox="0 0 24 24"
strokeWidth={1.5}
stroke="currentColor"
className="w-6 h-6"
>
<path
strokeLinecap="round"
strokeLinejoin="round"
d="M21 21l-5.197-5.197m0 0A7.5 7.5 0 105.196 5.196a7.5 7.5 0 0010.607 10.607z"
/>
</svg>
</AlgoliaButton>
)
}
```

### MDX plugins

Add the plugins to `remarkPlugins` in contentlayer or other MDX processors.
Expand Down

0 comments on commit 71451a3

Please sign in to comment.