Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
UI Component 作ってますか?
Search
Nobuki Inoue
August 29, 2018
Programming
580
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
UI Component 作ってますか?
Nobuki Inoue
August 29, 2018
More Decks by Nobuki Inoue
See All by Nobuki Inoue
Webサービスを作ってみて気づいたこと
black_trooper
0
500
10年使ったDBFluteに思う事
black_trooper
0
550
Riot.jsでSemanticUIを使ってみる
black_trooper
2
610
Other Decks in Programming
See All in Programming
動作中のプログラムの中身をリアルタイムに覗く / Realtime Debugger for CSharp with Roslyn
prota
1
1.8k
パズルゲームの作り方 / how to make puzzle games
kaityo256
PRO
2
290
Unity6 URPによる海底をテーマにしたVJシステムの解説 | Unity Shader 完全に理解した 勉強会
gam0022
0
360
Atomic Design, Enforced: Scaling Mobile Design Systems (next.app devCon / droidCon Berlin 2026)
steliosf
PRO
0
160
AIに “答え“を書かせるのを やめてみた
___akari11
0
120
The Rails Doctrine Decade
koic
2
560
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
570
パスワード再設定メールのURLについて知っておこう
uyuki234
0
140
TechTown - Creating Composable Callables in Contemporary C++
rollbear
0
100
ハーネス設計入門 〜 基礎知識の整理から実務へのステップアップ 〜
kinopeee
22
22k
Ghostty + Neovimで作る 透明でカッコ良い開発環境
j341nono
0
170
プロダクトコードからライブラリの境界を見つける
elmetal
PRO
0
110
Featured
See All Featured
svc-hook: hooking system calls on ARM64 by binary rewriting
retrage
2
620
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
Chasing Engaging Ingredients in Design
codingconduct
0
360
SEO in 2025: How to Prepare for the Future of Search
ipullrank
3
3.9k
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
1
850
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1.6k
Effective software design: The role of men in debugging patriarchy in IT @ Voxxed Days AMS
baasie
1
570
Information Architects: The Missing Link in Design Systems
soysaucechin
1
1.2k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
133
20k
How to optimise 3,500 product descriptions for ecommerce in one day using ChatGPT
katarinadahlin
PRO
3
3.9k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
A Modern Web Designer's Workflow
chriscoyier
699
190k
Transcript
UI Component 作ってますか? 2018/08/29 Riot.js LT大会@Tokyo #1
HELLO! 井上 暢己(いのうえ のぶき) @black_trooper フリーのWebエンジニア フロントエンドとサーバサイドどっちもやって ます。 2
Component 分割してますか? Riot.js はコンポーネント志向のUIフレームワークです 3
1 Page 1 Component 4 <sample> <div class="menu"> <a class="header
item" href="home"> <img src="images/logo.png" alt="" />Sampleサービス </a> <a class="item" href="contact">お問い合わせ</a> </div> <div class="tweet" each="{ tweet in tweets }"> <div class="item-header">{ tweet.full_name }</div> <div class="item"> { tweet.text } </div> <div class="item-footer"> <span class="reply">{ tweet.reply }件の返信</span> <span class="retweet">{ tweet.retweet }件のリツイート</span> <span class="favorite">{ tweet.favorite } いいね</span> </div> </div> </sample>
分割された Component 5 <common-header class="menu"> <a class="header item" href="home"> <img
src="images/logo.png" alt="" />Sampleサービス </a> <a class="item" href="contact">お問い合わせ</a> </common-header> <item-footer class="item-footer"> <span class="reply">{ opts.tweet.reply }件の返信</span> <span class="retweet">{ opts.tweet.retweet }件のリツイート</span> <span class="favorite">{ opts.tweet.favorite } いいね</span> </item-footer> <sample> <common-header></common-header> <div class="tweet" each="{ tweet in tweets }"> <div class="item-header">{ tweet.full_name }</div> <div class="item"> { tweet.text } </div> <item-footer tweet="{ tweet }"></item-footer> </div> </sample>
Component 公開してますか? 「自サイトに特化してるから他では使い道ないよ」 6 「たいしたもの作ってないし・・・」
他で使い道ないよ の例 Checkbox Component 初期値に戻す reset メ ソッド 初期値から変更された かを確認する
changed メソッド 7 <xx-checkbox> <label> <input type="checkbox" checked="{ checked }" onclick="{ click }" /> <yield /> </label> <script> this.checked = false this.defaultChecked = this.checked this.click = () => { this.checked = !this.checked } this.reset = () => { this.checked = this.defaultChecked } this.changed = () => { return this.checked !== this.defaultChecked } </script> </xx-checkbox> <xx-checkbox>利用規約に同意します </xx-checkbox> CSSの都合でこんな要望があることも - <yield /> は <span> で囲みたい - <input> に xxx というクラスを追加したい
CSSとセットじゃないと使いにくい 8
CSS Framework 使ってますか? 9 CSS Framework に特化した Component でいいじゃん!
CSS Framework の特徴 10 ▸ カンタンにカッコイイWebサイト が作成できる ▸ レスポンシブデザインに対応し ている
▸ JavaScript(主にJQuery)で DOMを直接いじる ▸ 仮装DOMでページを構成する UI Framework とは相性が悪い ▸ 対策として Component set が 作られた
Component set の一例 11 Angular React Vue Riot Bootstrap ngbootstrap
reactstrap Bootstrap + Vue Riot-bootstrap (v3) Semantic UI Semantic UI Angular (1.x) Semantic UI React Semantic UI Vue Semantic UI Riot Material Angular Material MATERIAL-UI Vue Material Riot MaterialUI Other RiotGear (for Braze CSS) (Riot 2.x)
Semantic UI Riot https://github.com/black-tr ooper/semantic-ui-riot Place your screenshot here 12
<su-radio-group ref="radio"> <su-radio value="1">Radio choice1</su-radio> <su-radio value="2">Radio choice2</su-radio> </su-radio-group> <script>
const getRadioValue = () => { return this.refs.radio.value } </script> Radio 13 <div class="ui radio checkbox"> <input type="radio" name="radio" ref="radio1" value="1"> <label>Radio choice1</label> </div> <div class="ui radio checkbox"> <input type="radio" name="radio" ref="radio2" value="2"> <label>Radio choice</label> </div> <script> const getRadioValuebyJQuery = () => { return $("[name=radio]:checked").val() } const getRadioValueByRiotRefs = () => { return this.refs.radio1.checked ? this.refs.radio1.value : (this.refs.radio2.checked ? this.refs.radio2.value : null) } </script> Before After 値の取得も簡単に! refsだけで頑張るとツラい TagとCSSの記述が簡潔
npm trends から見る UI Componentの 需要 どの UI Component も需要があるっぽい
14
まとめ ▸ Riot.js の Component を積極的に公開し よう❗ ▸ CSS Framework
に特化した Component も結構需要あるよ! ▸ 既存 Component set にない機能を作るも よし、推しCSS Framework向けの Component setを作るもよし ▸ Semantic UI Riot も使ってみてね 15 https://github.com/black-trooper/semantic-ui-riot
16 THANKS! ご清聴ありがとうございました。