1.1 #Components - Buttons Buttons

Toggle full screen Open in new window Toggle example guides Toggle HTML markup

Buttons are one of the most used components. It's the very basic way that users can interact with an application. Currently HolaKit provides 3 kinds of button: Normal buttons, primary buttons and Ghost buttons.

  • Normal Buttons: For general purpose.
  • Primary Buttons: For primary operations. Normally in a row of buttons, you have at least one primary buttons, for the most frequent usage.
  • Ghost Buttons: For banner and heroes. It's kind of call-to-action.

All buttons classes can be apply to form submits (<input type="submit">), HTML buttons (<button>) and links (<a>). In many cases you can also use just a bare a.hola-button, for links in a row with other buttons to be properly aligned.

Example
Markup: components/button.html
<p>
  <input type="submit" class="hola-button hola-button-normal" value="表单提交">
  <button class="hola-button hola-button-normal">&lt;button&gt; 组件</button>
  <a href="#" class="hola-button hola-button-normal">链接按钮</a>
</p>
<p>
  <a href="#" class="hola-button hola-button-primary">Primary Button</a>
  <a href="#" class="hola-button hola-button-ghost">Ghost Button</a>
</p>
Source: components/button.css, line 1

1.2 #Components - Cards Cards

Cards are the basic content blocks in HolaKit. You will be using it in most cases you need to host some content.

Source: components/card/index.css, line 1

1.2.1 #Components - Cards - Basic Basic Card

Toggle full screen Open in new window Toggle example guides Toggle HTML markup

Card components are blocks by default. We don't suggest using them as inlines or inline-blocks. Normally you would just wrap cards in card stack or get them in layouts so they won't get too wide. In some cases you want to wrap cards directly in containers: Fine, but don't do it every where, since cards can be too wide for desktop users. In the following example page, we explictly get a max width for demostration purpose.

Cards can't be too narrow too; Because we have great padding around cards, if you get 4 or more columns in a container, the whole page may looks too messy, and lines in each column will be too short for a comfortable reading experience.

Of course titles are accepted in cards and you will use them frequently. We also get head images for cards, and even pure image cards. Go ahead and make your app vivid.

We have patched cards for being used in links; Feel free to use them as clickable items, but don't use them as buttons. For example, you can use linked cards as article items in a list page of blog, but don't use a card titled "Click Here" as an action button. Card always contains some actual data, instead of pure commands / verbs.

Example

Basic Card Component

俱往矣,数风流人物,还看今朝。

Titled Card

Of course, cards can have a proper title.

Photo from Unsplash

Card with image

Card can comes with images. Make sure you have proper class set.

Photo from Unsplash
Markup: components/card/card.html
<div class="hola-card-stack" style="max-width: 300px">
  <div class="hola-card">
    <p>Basic Card Component</p>
    <p>俱往矣,数风流人物,还看今朝。</p>
  </div>
  <div class="hola-card">
    <h2 class="hola-card-title">Titled Card</h2>
    <p>Of course, cards can have a proper title.</p>
  </div>
  <div class="hola-card hola-card-with-image">
    <img src="https://source.unsplash.com/featured/?head" alt="Photo from Unsplash" class="hola-image">
    <h2 class="hola-card-title">Card with image</h2>
    <p>Card can comes with images. Make sure you have proper class set.</p>
  </div>
  <div class="hola-card hola-card-full-image">
    <img src="https://source.unsplash.com/featured/?sky" alt="Photo from Unsplash" class="hola-image">
  </div>
</div>
Source: components/card/card.css, line 1

1.2.2 #Components - Cards - Stacks Card Stack

Toggle full screen Open in new window Toggle example guides Toggle HTML markup

You have seen this in the basic section. But card stacks are more than a container of cards.

We have card stack titles to name the whole stack of cards, and they can be in both light and dark versions. In most cases you use dark versions, but in case you're using our hero component, you may need to set the first stack title to light version to match the dark blue extended hero background. Things can be much different when you're using a picture for heros, or a custom primary color. Try both color version to decide which suits best.

Card stacks can be used in combination with columns, and we automatically handle card margins to have correct shadow rendering - browsers wraps not only content but also any display effect applied to content in columns. Be aware, currently we only support using card stack columns directly under hola-container.

Example

Stack Title Light

Stack Title

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Laborum, sequi.
Praesentium odio, voluptate nihil dolore repellat, aperiam quae adipisci numquam.
Saepe sequi iste neque, voluptatum quidem ducimus placeat obcaecati eum.
Markup: components/card/stack.html
<div style="background: #3498db; padding: 2rem;">
  <h3 class="hola-card-stack-title hola-card-stack-title-light">Stack Title Light</h3>
</div>

<h3 class="hola-card-stack-title">Stack Title</h3>
<div class="hola-card-stack" style="max-width: 300px">
  <div class="hola-card">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Laborum, sequi.</div>
  <div class="hola-card">Praesentium odio, voluptate nihil dolore repellat, aperiam quae adipisci numquam.</div>
  <div class="hola-card">Saepe sequi iste neque, voluptatum quidem ducimus placeat obcaecati eum.</div>
</div>
Source: components/card/stack.css, line 1

1.3 #Components - Info Sheet Info Sheet

Toggle full screen Open in new window Toggle example guides Toggle HTML markup

Info Sheet is simply designed for displaying key-value-paired data. It's only for plain text data and you should never try to embed any other compoents in it, except badges. It's great for showing something like a ticket or pass. Also make sure that your key should be concise; Longer key may result in a ugly multiline label.

Example
用户名

laosb

手机号码

+1 (555) 555 5555

备注

并不住在美国,但是用着一个美国手机号。他是 Holakit 的最初作者及维护者,常常诈尸。

Markup: components/infosheet.html
<div class="hola-infosheet">
  <div class="hola-infosheet-row">
    <span class="hola-infosheet-key">用户名</span>
    <p class="hola-infosheet-value">laosb</p>
  </div>
  <div class="hola-infosheet-row">
    <span class="hola-infosheet-key">手机号码</span>
    <p class="hola-infosheet-value">+1 (555) 555 5555</p>
  </div>
  <div class="hola-infosheet-row">
    <span class="hola-infosheet-key">备注</span>
    <p class="hola-infosheet-value">并不住在美国,但是用着一个美国手机号。他是 Holakit 的最初作者及维护者,常常诈尸。</p>
  </div>
</div>
Source: components/infosheet.css, line 1