Skip to content

Add "add bulma" recipe #344

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions docs/recipes/ui/add-bulma.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# How do I add Bulma to a SAFE project?

[Bulma](https://bulma.io/documentation/) is a free open-source UI framework based on flexbox that helps you create modern and responsive layouts.

When using Feliz (the standard for a SAFE app), follow the instructions below. When using Fable.React, use the [Fulma](https://fulma.github.io/Fulma/) wrapper for Bulma.

## 1. Add the Feliz.Bulma NuGet package to the client project

```
dotnet paket add Feliz.Bulma -p Client
```

## 2. Add the Bulma stylesheet to `index.html`

```.diff
...
<head>
...
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bulma@0.9.4/css/bulma.min.css">
</head>
...
```

## 3. Start using Feliz.Bulma components in your F# files.

```fsharp
open Feliz.Bulma

Bulma.button.button [
str "Click me!"
]
```
1 change: 1 addition & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ nav:
- Add Feliz support: "recipes/ui/add-feliz.md"
- Add FontAwesome support: "recipes/ui/add-fontawesome.md"
- Migrate from a CDN stylesheet to an NPM package: "recipes/ui/cdn-to-npm.md"
- Add Bulma Support: "recipes/ui/add-bulma.md"
- Add routing with state shared between pages: "recipes/ui/add-routing.md"
- Add routing with separate models per page: "recipes/ui/add-routing-with-separate-models.md"
- Add Routing with UseElmish: "recipes/ui/routing-with-elmish.md"
Expand Down