投稿時間:2023-03-19 19:12:44 RSSフィード2023-03-19 19:00 分まとめ(14件)

カテゴリー等 サイト名等 記事タイトル・トレンドワード等 リンクURL 頻出ワード・要約等/検索ボリューム 登録日
python Pythonタグが付けられた新着投稿 - Qiita デシル分析とRFM分析 https://qiita.com/KWBT_ECON/items/1acfe3d95a2e88115812 decileanalysis 2023-03-19 18:48:39
python Pythonタグが付けられた新着投稿 - Qiita PythonでMySQLにクエリを投げて結果をJSONで取得 その2 https://qiita.com/mary_sue_act_2/items/21087acd7a9539396a1c mysql 2023-03-19 18:00:31
js JavaScriptタグが付けられた新着投稿 - Qiita 小道具: String.normalize 結果の可視化 https://qiita.com/ikiuo/items/fb8877cc3471f5f7d9fc seethepen 2023-03-19 18:37:53
js JavaScriptタグが付けられた新着投稿 - Qiita chatGPTでマインスイーパーを作る。 https://qiita.com/YR_programmer/items/51ea2a9498d32ac981a8 rsetutfgtlttitlegtmineswe 2023-03-19 18:18:02
AWS AWSタグが付けられた新着投稿 - Qiita [Terraform]機密情報を扱う際の注意点 https://qiita.com/to-fmak/items/0acfadb44adc0ed3befd terraform 2023-03-19 18:51:18
AWS AWSタグが付けられた新着投稿 - Qiita CDKコマンド実行時にアカウントとリージョンがないと言われた話 https://qiita.com/masaozi3/items/f49f5a9c0392a34e2293 retrievevaluefromcontextp 2023-03-19 18:48:29
Docker dockerタグが付けられた新着投稿 - Qiita OpenResty(Nginx)とluaでBasic認証+認可を実装する https://qiita.com/v1tam1n/items/4e299d4411d407e2866c ubuntudockerv 2023-03-19 18:24:53
Azure Azureタグが付けられた新着投稿 - Qiita Microsoft Azureに入門しよう - Azure Fundamental(AZ900レベル) https://qiita.com/ymd65536-ms/items/590c96242309039d8fa3 azure 2023-03-19 18:38:15
技術ブログ Developers.IO Amazon Genomics CLI 実行環境の作り方紹介 https://dev.classmethod.jp/articles/how-to-build-amazon-genomics-cli-on-docker/ inventoryiconscreatedby 2023-03-19 09:25:39
海外TECH DEV Community Say Goodbye to Boring Dropdowns: Create Custom Dropdown Menus with Headless UI https://dev.to/nitinfab/say-goodbye-to-boring-dropdowns-create-custom-dropdown-menus-with-headless-ui-1p5b Say Goodbye to Boring Dropdowns Create Custom Dropdown Menus with Headless UICreating a website is no small feat It requires careful planning strategic design and thoughtful implementation And one of the most crucial elements of any website is its user interface UI A website s interactive UI components serve as the gateway through which users interact with the site and they play a critical role in shaping the user experience From dropdown menus to modals to tabs UI components are essential in making websites more user friendly and intuitive But integrating these components is no easy task since they also have to be fully accessible as well as have reusability and customization options And that s where Headless UI comes to the rescue Headless UI is an npm package that offers a practical solution to this problem It enables you to build completely unstyled UI components that are fully accessible and easy to integrate into your website It is created by Tailwind Labs who are also the creators of TailwindCSS By using Headless UI you can focus more on styling your components with TailwindCSS and less on the functionality and accessibility side of things This separates Headless UI from other much more opinionated UI libraries such as Chakra and Bootstrap as the entire onus for styling is on the developer And based on that we will be building a dropdown menu using Headless UI and TailwindCSS in this blog Let s start Setting Up the Dev EnvironmentWhen you want to use TailwindCSS inside a React app you must first set it up and configure it First create a React app by running the command npx create react app my appNext install TailwindCSS and other dependencies like postcss and autoprefixer using the command npm install D tailwindcss postcss autoprefixerCreate config files by running the command npx tailwindcss init pNow open the tailwind config css file and replace the content with the provided code snippet type import tailwindcss Config module exports content src js jsx ts tsx theme extend plugins Paste the following code snippet inside the src index css file tailwind base tailwind components tailwind utilities You can now use TailwindCSS in your React app Installing Headless UI is relatively simple just run this command and then you can use it anywhere inside your React app npm install headlessui react Creating a Traditional Dropdown MenuWhile creating a basic dropdown menu is a relatively straightforward task it can become cumbersome and keep you from implementing much more important features import useState from react function App const isOpen setIsOpen useState false return lt div className relative inline block text left gt lt button type button className inline flex justify center w full rounded md border border gray shadow sm px py bg white text sm text gray hover bg gray onClick gt setIsOpen isOpen gt More lt button gt isOpen amp amp lt div className absolute z mt w rounded md shadow lg bg white gt lt div className py role menu aria orientation vertical aria labelledby options menu gt lt a href account settings className block px py text sm text gray hover bg gray hover text gray role menuitem gt Account settings lt a gt lt a href documentation className block px py text sm text gray hover bg gray hover text gray role menuitem gt Documentation lt a gt lt span className block px py text sm text gray opacity role menuitem gt Invite a friend coming soon lt span gt lt div gt lt div gt lt div gt export default AppTo create a functional dropdown menu you have to write about lines of code as shown above And even with that it often lacks critical functionalities in terms of accessibility and user experience For example you may not be able to click outside the panel to close the dropdown or navigate using keyboard keys For that you can add multiple lines of code to address these issues but it can be time consuming and tedious That s where UI libraries like Headless UI can be incredibly helpful as they provide pre built components that offer accessibility and navigation support Creating a Customisable Dropdown Menu with Headless UIWhen using Headless UI for a dropdown menu it s important to understand the basic concepts There are four primary components “Menu “Menu Button “Menu Items and “Menu Item As the names suggest the “Menu component contains everything the “Menu Button is essentially a button and the “Menu Items component contains multiple “Menu Item components This concept of components composition is the cornerstone of Headless UI and you will see this pattern repeat for other UI components such as popovers and dialogs With that said here is the basic code based on the official documentation import Menu from headlessui react function App return lt Menu gt lt Menu Button gt More lt Menu Button gt lt Menu Items gt lt Menu Item gt active gt lt a className active amp amp bg blue href account settings gt Account settings lt a gt lt Menu Item gt lt Menu Item gt active gt lt a className active amp amp bg blue href account settings gt Documentation lt a gt lt Menu Item gt lt Menu Item disabled gt lt span className opacity gt Invite a friend coming soon lt span gt lt Menu Item gt lt Menu Items gt lt Menu gt export default App In the code snippet the “active property is used as an argument to the function When “active is true the className property of the “a element will be set to “bg blue giving it a blue background color Conversely when “active is false the className property will be set to an empty string removing the background color Also this code provides improved functionality for instance allowing users to navigate the dropdown menu using their keyboard closing the dropdown by clicking outside and many more Now that we have a functional dropdown menu it s time to add some styling Since we have installed TailwindCSS we can use it to add style to our menu import Menu from headlessui react function App return lt div className shadow md bg white w gt lt Menu gt lt Menu Button className px py text sm font medium text gray gt More lt Menu Button gt lt Menu Items className py text sm font medium text gray gt lt Menu Item gt active gt lt a className block px py active bg blue text white text gray href account settings gt Account settings lt a gt lt Menu Item gt lt Menu Item gt active gt lt a className block px py active bg blue text white text gray href account settings gt Documentation lt a gt lt Menu Item gt lt Menu Item disabled gt lt span className block px py text gray gt Invite a friend coming soon lt span gt lt Menu Item gt lt Menu Items gt lt Menu gt lt div gt export default AppHere is the output The customizability doesn t stop here ーHeadless UI also allows you to further tailor the functionality of your dropdown menu For example you can manually control when the menu opens and closes by passing the open andclose props to the relevant components For instance you can check the code below which uses the open andclose props import Menu from headlessui react function App return lt Menu gt open gt lt gt lt Menu Button gt More lt Menu Button gt open amp amp lt div gt lt Menu Items static gt lt Menu Item gt active gt lt a className active bg gray text gray text gray block px py text sm href account settings gt Account settings lt a gt lt Menu Item gt lt Menu Item gt active gt lt a className active bg gray text gray text gray block px py text sm href documentation gt Documentation lt a gt lt Menu Item gt lt Menu Item disabled gt lt span className block px py text sm text gray gt Invite a friend coming soon lt span gt lt Menu Item gt lt Menu Items gt lt div gt lt gt lt Menu gt export default AppAnd there are more such components API that Headless UI provides With these powerful features you can create a truly bespoke dropdown menu that meets all of your unique requirements Unleashing the Power of Headless UISpeaking about integration Headless UI can be easily integrated into React and Next js applications And you can seamlessly add styles to your components with TailwindCSS as well Another key benefit of using Headless UI is its excellent accessibility features like focus management mouse interaction and keyboard interaction Also the library has taken care of all relevant ARIA attributes and provided several other props like “active “open “close “as “unmount and many more to help you further customize the components as per your needs So whether you want to build a simple dropdown menu or a more complex UI component Headless UI provides all the necessary functionality and accessibility features to make your development process easier and more efficient While Headless UI is great for building accessible UI components that work out of the box and integrate seamlessly with TailwindCSS you still need a responsive React codebase with TailwindCSS to get started You can generate responsive code directly from your design files in Figma and Adobe XD using the Locofy ai plugin Locofy automatically picks up your Figma auto layout settings and constraints to generate responsive code with flex properties Additionally you can choose to use TailwindCSS as the default styling option as well so your Locofy generated code will utilize TailwindCSS for handling styles You can then use these Headless UI components to incorporate accessible drop downs auto complete tabs and other such components Hope you like it That s it ーthanks 2023-03-19 09:55:55
海外TECH DEV Community Legislating AI https://dev.to/niza/legislating-ai-2a6e Legislating AIEvery field including artificial intelligence calls for the development of public sector policies and laws for regulating them in every jurisdiction all legal boundaries globally Regulation is necessary to both encourage AI and manage associated risks I liken the current state of AI regulation to kids playing and all of a sudden they come back crying with various injuries because no rules were laid down for how they should play There are still a lot of unanswered questions in many territories about simple things like copyright do AI s have copyrights if an AI is modeled on a person s data does the person have any ownership are there forbidden AI algorithms or is it the wild west these and many more are some of the things to consider deliberately It is important that there are legislative frameworks for judges and lawyers to follow on how to approach AI related cases If all the legal cases involving AI are brought to court without existing legal frameworks the AI companies will win most of the cases they typically have more money and better lawyers It will also continue to favour them in future because of the legal precedence established What do you think important components of AI law should be 2023-03-19 09:31:20
海外ニュース Japan Times latest articles After Grand Slam triumph, Johnny Sexton dreams of World Cup glory https://www.japantimes.co.jp/sports/2023/03/19/rugby/ireland-sexton-six-nations-grand-slam/ world 2023-03-19 18:30:39
海外ニュース Japan Times latest articles Tsukasa Shiotani strike sends Sanfrecce past winless Reysol https://www.japantimes.co.jp/sports/2023/03/19/soccer/j-league/sanfrecce-reysol-shiotani/ Tsukasa Shiotani strike sends Sanfrecce past winless ReysolIn the day s other game Yuya Yamagishi scored two fine goals deep into the nine minutes of stoppage time as Avispa Fukuoka grabbed a dramatic 2023-03-19 18:15:15
ニュース BBC News - Home Public emergency alerts to be sent to all UK mobile phones https://www.bbc.co.uk/news/uk-64999417?at_medium=RSS&at_campaign=KARANGA siren 2023-03-19 09:43:50

コメント

このブログの人気の投稿

投稿時間:2021-06-17 05:05:34 RSSフィード2021-06-17 05:00 分まとめ(1274件)

投稿時間:2021-06-20 02:06:12 RSSフィード2021-06-20 02:00 分まとめ(3871件)

投稿時間:2020-12-01 09:41:49 RSSフィード2020-12-01 09:00 分まとめ(69件)