Skip to content

Instantly share code, notes, and snippets.

@elievischel
elievischel / dynamic_input_fields.html
Created July 18, 2024 15:02 — forked from awebartisan/dynamic_input_fields.html
Dynamic input fields with Alpine.js
<div x-data="{ bankAccounts: [{
id: '',
accountNumber: ''
}] }">
<template x-for="(bankAccount, index, bankAccounts) in bankAccounts" :key="index">
<div class="grid grid-cols-6 gap-6 mt-2">
<div class="col-span-3 md:col-span-3 sm:col-span-2">
<x-jet-label for="city">Bank</x-jet-label>
<select :name="`bank_info[${index}][bank_id]`" id="bank"
class="border-gray-300 focus:border-indigo-300 focus:ring focus:ring-indigo-200 focus:ring-opacity-50 rounded-md shadow-sm mt-1 block w-full">
@elievischel
elievischel / Masonry.js
Last active March 12, 2022 03:30
React - Horizontal Masonry
import MasonryTile from "./Tile";
const Masonry = ({ intl }) => (
<div className="masonry">
<MasonryTile image="/static/images/women/hanzi_zhen.jpg" alt="Masonry Brick #1"/>
<MasonryTile image="/static/images/women/hanzi_zhen.jpg" alt="Masonry Brick #1"/>
<MasonryTile image="/static/images/women/hanzi_zhen.jpg" alt="Masonry Brick #1"/>
<MasonryTile image="/static/images/women/hanzi_zhen.jpg" alt="Masonry Brick #1"/>
<style jsx>{`
.masonry {