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
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
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
速習iPhone Duo対応
yuukiw00w
2
860
ハーネス設計入門 〜 基礎知識の整理から実務へのステップアップ 〜
kinopeee
18
19k
AgentCore CLI で進化した AWS での AI エージェントの作り方 : 必要な機能を必要な時に
icoxfog417
PRO
3
390
標準パッケージに uuid が追加された 背景から見る Go らしい意思決定 / go_127_uuid_decision
convto
5
8.9k
iOSDCのペンライトを自動制御したい!
akkeylab
0
130
IBM Bob Dojo #1 仕様駆動開発入門
oniak3ibm
PRO
0
300
Omarchy Tokyo やると聞いて UMPC 買ってセットアップしてきた
mtsmfm
0
180
Apple Intelligence を用いた個人情報誤送信防止、及びユーザーリクエスト体験の改善について
yukiny
0
200
スマートフォンでモールス信号を送受信する 〜スマートフォンのLEDとカメラで作る光通信の設計と実装〜
atsuki_seo
0
210
Verilogで学ぶCPU自作入門.pdf
uyuki234
8
3.7k
更なる可用性を求めて、5年間運用したKotlinのアプリケーションをGoでリプレイスする話
ken_tunc
0
390
スマート反転とウェブアクセシビリティ
camiha
0
220
Featured
See All Featured
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
310
YesSQL, Process and Tooling at Scale
rocio
174
15k
Google's AI Overviews - The New Search
badams
0
1.6k
Effective software design: The role of men in debugging patriarchy in IT @ Voxxed Days AMS
baasie
1
540
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
440
Building the Perfect Custom Keyboard
takai
2
890
What Being in a Rock Band Can Teach Us About Real World SEO
427marketing
0
1.1k
HDC tutorial
michielstock
2
920
Getting science done with accelerated Python computing platforms
jacobtomlinson
2
490
GraphQLとの向き合い方2022年版
quramy
50
15k
Designing Experiences People Love
moore
143
24k
brightonSEO & MeasureFest 2025 - Christian Goodrich - Winning strategies for Black Friday CRO & PPC
cargoodrich
3
850
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! ご清聴ありがとうございました。