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
TechTown - Creating Composable Callables in Contemporary C++
rollbear
0
130
AIで開発が速くなった先で、開発チームは何を目指すか
shihochan
1
1.6k
R8 の設定見直しでアプリサイズ削減
andpad
0
220
[2026-10-09]一枚の布で作らなくてもいい。 信頼性は「パッチワーク」で紡がれる~既存の運用と新しい可能性をつなぎ合わせてきたCREの話~
tosite
0
110
気持ちぃ〜角丸 Squircle
ryu1013
0
320
Rでドレミ/Do-Re-Mi_with_R
florets1
0
130
Herb in Rails 8.2: Your ERB views, now HTML-aware @ Kaigi on Rails 2026, Tokyo, Japan
marcoroth
2
300
[Dev Group Paris Octobre 26] Agentforce, SIforce, Claudeforce, Slackbot… on s'y retrouve ?
nabondance
0
110
GemmaをJevのように使ってみる / Use Gemma like Jev
kishida
5
800
Jetpack Compose Mechanisms
skydoves
3
830
Unity6 URPによる海底をテーマにしたVJシステムの解説 | Unity Shader 完全に理解した 勉強会
gam0022
0
370
dotNET_vulnclicker_intro.pdf
deka_morita
0
150
Featured
See All Featured
Making Projects Easy
brettharned
120
6.8k
[RailsConf 2023] Rails as a piece of cake
palkan
59
7.1k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
38
3.1k
Facilitating Awesome Meetings
lara
57
7.2k
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
600
The World Runs on Bad Software
bkeepers
PRO
72
12k
First, design no harm
axbom
PRO
2
1.3k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
28
3.7k
Building Better People: How to give real-time feedback that sticks.
wjessup
371
20k
Ethics towards AI in product and experience design
skipperchong
2
440
Exploring the relationship between traditional SERPs and Gen AI search
raygrieselhuber
PRO
4
4.4k
Heart Work Chapter 1 - Part 1
lfama
PRO
10
37k
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! ご清聴ありがとうございました。