Skip to content

Best way to handle invalid state for InputText when using PassThrough #235

Discussion options

You must be logged in to vote

invalid is not a property or a special context object for PrimeVue components. PrimeVue designer provides some additional class styles like p-invalid and if you want to add an invalid style class with Tailwind there is a way for this. Firstly, you could find the Tailwind InputText object of PrimeVue here https://primevue.org/inputtext/#theming.tailwind. You may choose to copy-paste or create a custom new Tailwind object.

Let's say you did create a custom invalid property:

<InputText type="text" v-model="value" :invalid="true" />

The pt object can find all properties from global main.js and then customize it as you wish.

app.use(PrimeVue, {
  unstyled: true,
  pt: {
    inputtext: {
      …

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@jfitzsimmons2
Comment options

Answer selected by tugcekucukoglu
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants