Giter Site home page Giter Site logo

solarliner / preact-bulma Goto Github PK

View Code? Open in Web Editor NEW
27.0 2.0 2.0 8.01 MB

Preact components for the Bulma CSS project.

Home Page: https://solarliner.github.io/preact-bulma

License: MIT License

TypeScript 98.29% HTML 0.20% JavaScript 1.49% SCSS 0.02%
preact bulma css js

preact-bulma's Introduction

Preact Bulma ⚛️

A collection of components to build interfaces with Bulma.

npm install preact-bulma

For the version targeting Preact X, use

npm install preact-bulma@next

v1 but still in alpha! Here's why.

Getting started

1. Install

preact-bulma has a peer dependency on Preact, which means you need to install it separately, but allows you to choose the version. The project supports 8.2.x and up.

2. Add styling

The project doesn't import any styling by default - this is to let you have full control over the style. You can import the full Bulma framework, or, using SASS/SCSS, only pull the parts that you want.

Full Bulma bundle (default theme, no customization, easiest)

// Import Bulma CSS
import "bulma/css/bulma.min.css";

Custom styling (allows customization, recommended)

// Import SCSS file
import "styles/app.scss";
@charset "utf-8";
// Import *all* of Bulma - refer to the customization guide for more info on customizing Bulma:
// https://bulma.io/documentation/customize/
@import "~bulma/bulma";

3. Use preact-bulma

You can now use the provided components into your project as you would with any component.

import { Card } from "preact-bulma";
function MyCard() {
  <Card.Card>
    <Card.Header
      title="Physics breakthrough"
      icon="fas fa-exclamation-circle"
    />
    <Card.Content>
      No, really, literally. Black holes have been proven to break through
      spacetime. (get it?)
    </Card.Content>
    <Card.Footer>
      <Card.FooterItem>Share</Card.FooterItem>
    </Card.Footer>
  </Card.Card>;
}

Links

preact-bulma's People

Contributors

dependabot[bot] avatar jcolbyfisher avatar solarliner avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

preact-bulma's Issues

Navbar.MenuItem shows arrow for non-dropdown items.

When you create a new MenuItem in a navbar, it will always have a little arrow on the right side that indicates that it is a dropdown, even when it is not a dropdown (see the storyboard).

This code:

<Navbar.MenuItem href="#">Link</Navbar.MenuItem>

generates the following html:

<div class="navbar-item"><a class="navbar-link" href="#">Link</a></div>

However, I expect it to generate one of the following pieces of html:

<div class="navbar-item"><a class="navbar-link is-arrowless" href="#">Link</a></div>
<a class="navbar-item" href="#">Link</a>

In both cases, the arrow is not rendered.

My current workaround is the following:

<Navbar.Navbar>
    <Navbar.Menu side="end">
        <a href="#" class="navbar-item">Lap Times</a>
    </Navbar.Menu>
</Navbar.Navbar>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.