Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Reactで学ぶUIコンポーネントデザイン / UI Component Design wit...
Search
mikesorae
July 12, 2017
Technology
3.4k
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Reactで学ぶUIコンポーネントデザイン / UI Component Design with React
mikesorae
July 12, 2017
More Decks by mikesorae
See All by mikesorae
AI Native なプロダクト組織の立ち上げ方 : 生産性 100 倍への挑戦
mikesorae
0
4.7k
Dataflow周りで地雷を踏みまくった話
mikesorae
0
21
Functional Programming in Frontend Elm編
mikesorae
1
140
Other Decks in Technology
See All in Technology
Beyond the Hype: Practical AI for Your Oracle Database with MCP
thatjeffsmith
1
260
Amazon S3 Tablesに全部任せてみた結果——コンパクション/スナップショット管理は本当に手放せるか
shigeruoda
0
390
『止めない』を設計する — 制約の中で、事業の根幹を支える判断
hiroyaterui
0
190
Where Is JetBrains AI Heading- — Central CLI, Air Alpha, and the Agentic Development Stack
x5gtrn
PRO
0
130
現場に行くだけでは足りない——プロダクトエンジニアが業務の流れを捉える観点と、その鍛え方
takumiengineering
0
280
推論の観測、できていますか? 〜 Google Cloud Gemini Enterprise Agent Platformで 3つの Gemini モデルを実測して踏んだ、評価の罠 〜
shukob
PRO
0
150
いかに伝えるか 〜新卒エンジニアの教育のための、ライトノベル活用の一例
ikedon
1
200
bet_ai_day_2026_session02
agenticsec
1
980
DGX Sparkを2台使って いろいろ動かす話
sonoda_mj
1
130
ブラウザアプリの継続的パフォーマンスモニタリング (序) / Continuous Browser Application Performance Monitoring; Act 1
moznion
0
110
AI時代におけるプロダクト横断勉強会の設計
zozotech
PRO
0
150
AI時代に、プロダクトの数だけ積み上がる所有コストをどうエンジニアリングするか / Engineering the Cost of Ownership
kzkmaeda
0
1k
Featured
See All Featured
We Analyzed 250 Million AI Search Results: Here's What I Found
joshbly
1
1.9k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
Building a Modern Day E-commerce SEO Strategy
aleyda
45
9.2k
Believing is Seeing
oripsolob
1
210
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
123
22k
Pawsitive SEO: Lessons from My Dog (and Many Mistakes) on Thriving as a Consultant in the Age of AI
davidcarrasco
0
240
Information Architects: The Missing Link in Design Systems
soysaucechin
1
1.1k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
232
55k
VelocityConf: Rendering Performance Case Studies
addyosmani
331
25k
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.8k
Color Theory Basics | Prateek | Gurzu
gurzu
0
460
Ruling the World: When Life Gets Gamed
codingconduct
0
320
Transcript
ReactͰֶͿ UIίϯϙʔωϯτ σβΠϯ
ࣗݾհ • iOS/AndroidΞϓϦ։ൃ • 6ؒͰ30ຊͷεϚϗΞϓϦΛઃܭ/ • ͳͷͰUIͷநԽ͕͖ • ϑϩϯτΤϯυ •
੩తαΠτ͔ΒSPA·Ͱ • γεςϜΞʔΩςΫτݟश͍
Α͔ͬͨ͜ͱ • νʔϜϝϯόʔ͕ComponentࢦͰ࡞ΕΔΑ ͏ʹͳͬͨ • ઃܭൣғ͕໌֬ʹͳͬͨ • SMACSSBEMΛ͋·Γߟ͑ͳͯ͘Α͘ͳͬ ͨ
ͭ·͖ͮͲ͜Ζ • நԽͷ୯Ґ • ঢ়ଶΛ࣋ͭॴ • ෳࡶ͗͢ΔΠϯλʔϑΣʔε
React Basic Theoretical Concepts (ൈਮ)
Transformation • UIσʔλ͔Βผͷσʔλܗࣜͷ୯ͳΔ ӨͰ͋Δɻ Original Data Presentational Data
Abstraction • UI࠶ར༻ՄೳͳཁૉʹநԽՄೳͰɺ͜Ε Β࣮ͷৄࡉΛ֎෦ʹ࿙ग़͠ͳ͍ɻ Component CSS Scroll Moment Timer Velocity
Composition • ෳͷUIͷநΛ߹ͯ͠ผͷநΛ࡞͢ Δɻ Card Search Bar Filterable CardList Card
State • UI୯ͳΔαʔόɾϏδωεϩδοΫͷঢ়ଶ ͷίϐʔͰͳ͍ɻ(ͷͰ࣌ʹUIͷঢ়ଶΛ࣋ ͭ͜ͱ͕ඞཁ) Original Data Presentational Data State
UserEvent
Presentational / Container Component
Presentational & Container Container Presentational Presentational Presentational Presentational Container Presentational
Presentational Component • Presentational Componentͷؔ৺͝ͱݟͨ ͷΈɻ • ΠϕϯτॲཧσʔλͷՃContainerʹ ͤΔ
Container Component • ϏδωεϩδοΫPresentational Componentؒͷ૬ޓ࡞༻Λཧ͢Δɻ • ಛʹFlux ArchitectureͰstoreΛComponent ʹඥ͚ΔׂΛ࣋ͭɻ
UIͷநԽ
UIίϯϙʔωϯτͷղ
ϩάΠϯϑΥʔϜͷ߹ • ID/Passwordೖྗ͕Ͱ͖Δ • ID/ύεϫʔυ͕8จࣈҎͷ߹Τ ϥʔΛදࣔ͢Δ • ೖྗΤϥʔ͕͋Δͱ͖ϩάΠϯϘλ ϯΛΫϦοΫͰ͖ͳ͍ •
ϩάΠϯϘλϯΛΫϦοΫ͢Δͱid/ passwordΛฦ͢ id hogehoge password ******* id must be at least 8 characters Login
σʔλߏΛߟ͑Δ id hogehoge password ********* Login ϩάΠϯϑΥʔϜ - ϢʔβID -
ύεϫʔυ
ৼΔ͍Λݟ͚ͭΔ id hogehoge password ********* Login ϩάΠϯϑΥʔϜ - ϢʔβID -
ύεϫʔυ - IDΛνΣοΫ͢Δ - ύεϫʔυΛνΣοΫ͢Δ - ϩάΠϯϘλϯΛ༗ޮʹ͢Δ - ϩάΠϯϘλϯΛແޮʹ͢Δ
ঢ়ଶΛݟ͚ͭΔ 送信不可 送信可能 検証OK 検証NG ૹ৴Մ൱ঢ়ଶ ೖྗݕূঢ়ଶ
࣮ʹམͱ͠ࠐΉ LoginForm - userId: string - password: string - onSubmit:
function - validateUserId(userId): bool - validatePassword(userId): bool - canSubmit: bool - handleSubmit(userId, password) <LoginForm userId={this.props.userId} password={this.props.password} onSubmit={this.handleSubmit} />
͏গ͠൚༻తʹ͢Δ • όϦσʔλʔΛ֎͔Βઃఆ͍ͨ͠ • ೖྗϑΟʔϧυΛ࠶ར༻Ͱ͖ΔΑ͏ʹ͍ͨ͠
ݟͨʹूத͢Δ Container LoginForm Input Input SubmitButton Validator Validator
ίϯϙʔωϯτΛׂ͢Δ LoginForm - userId: string - password: string - userIdValidator:
function - passwordValidator: function - onSubmit: function - handleSubmit(userId, password) Input - value: string - type: string - onChange: function - handleChange(value) SubmitButton - value: string - disable: bool - onClick: function - handleClick() ೖྗͱݕূؔʹΑͬͯ Ұҙʹݟ͕ܾͨ·ΔUIίϯϙʔωϯτ͕Ͱ͖Δ
·ͱΊ • UIجຊతʹσʔλͱঢ়ଶͷදݱͰ͔͠ͳ͍ • ΠϯλʔϑΣʔεϑΝʔετͰߟ͑Α͏ • ෦࣮ΛӅṭ͠Α͏ • ԼҐίϯϙʔωϯτͰ͖Δ͚ͩදࣔʹઐ೦ ͠Α͏