drnic / polaris_view_components

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Polaris ViewComponents

Polaris ViewComponents is an implementation of the Polaris Design System using ViewComponent.

This library is under active development. Breaking changes are likely until stable release.

Usage

Render Polaris ViewComponents via helpers:

<%= polaris_card(title: "Title") do %>
  <p>Card example</p>
<% end %>

or the full version:

<%= render Polaris::CardComponent.new(title: "Title") do %>
  <p>Card example</p>
<% end %>

Installation

In Gemfile, add:

gem 'polaris_view_components', github: 'baoagency/polaris_view_components'

To add styles for Polaris::ShopifyNavigation::Component in your layout's <head> tag add:

<%= stylesheet_link_tag 'polaris_view_components' %>

Dependencies

In addition to the dependencies declared in the gemspec, Polaris ViewComponents assumes the presence of Polaris CSS.

Development

To get started:

  1. Run: bundle install
  2. Run: foreman start

It will open demo app with component previews on localhost:4000. You can change components and they will be updated on page reload. Component previews located in demo/test/components/previews.

License

The gem is available as open source under the terms of the MIT License.

About

License:MIT License


Languages

Language:Ruby 70.9%Language:HTML 20.8%Language:JavaScript 6.5%Language:CSS 1.8%