
Company News
Socket Named Top Sales Organization by RepVue
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.
@phx-hook/textarea
Advanced tools
Adapt the height of a textarea to its contents.
import TextareaHook from "@phx-hook/textarea";
const hooks = {
Textarea: TextareaHook({ /* options */ }),
};
let liveSocket = new LiveSocket("/live", Socket, { hooks, ... });
<.form for={@form} phx-submit="submit" phx-change="validate">
<.input
type="textarea"
field={@form[:text]}
phx-hook="Textarea"
data-max-height="250"
data-on-submit={JS.dispatch("scroll-to-bottom")}
data-submit-on-enter
/>
</.form>
defaultMaxHeight: An integer value in pixels to use as the max height for textareas with this hook. Defaults to Infinity.data-max-height: An integer value in pixels used to constrain the height of the textarea. Overrides defaultMaxHeight.data-on-submit: A Phoenix.LiveView.JS command to execute when Enter triggers form submission. Useful for performing additional actions like scrolling or hiding elements after submit.data-submit-on-enter: If present, the form containing the textarea will be submitted when the "Enter" key is pressed.By default, textareas are resizable. To disable resizing using Tailwind, add a resize-none class to your textarea element.
Phoenix projects come with a input/1 component already included. You can apply this hook to all of your textareas by adding it this function component, where the function head matches on %{type: "textarea"} = assigns. Consider also adding resize="none" to disable manual resizing.
FAQs
Adapt the height of a textarea to its contents
We found that @phx-hook/textarea demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.